package xxl.robotlegs.framework.impl 
{
	import flash.utils.Dictionary;
	/**
	 * ...
	 * @author XXL
	 */
	public class Pin 
	{
		private const _instances:Dictionary = new Dictionary();
		
		public function Pin() 
		{
			
		}
		
		public function detain(instance:Object):void
		{
			if (!_instances[instance])
			{
				_instances[instance] = true;
			}
		}
		
		public function release(instance:Object):void
		{
			if (_instances[instance])
			{
				delete _instances[instance];
			}
		}
		
		public function releaseAll():void
		{
			for (var instance:Object in _instances)
			{
				release(instance);
			}
		}
		
	}

}